//统计动态模拟
private _count_all = count AllGroups;
private _count_cur = 0;
{
	_group addGroupIcon ["b_inf",[0,0]];

	if(simulationEnabled (leader _x))then{ 
		if(dynamicSimulationEnabled _x)then{
			_x setGroupIconParams [[0,1,0,1],"已模拟（动态模拟已启用）",1,true];
		}else{
			_x setGroupIconParams [[0,1,0,1],"已模拟",1,true];
		};
		_count_cur = _count_cur + 1;
	}else{
		_x setGroupIconParams [[0,0,0,1],"停止模拟",1,true];
	};
}forEach AllGroups;

hint format["%1/%2", _count_cur, _count_all];


//检测单位动态模拟
dynamicSimulationEnabled  cursorTarget
simulationEnabled  cursorTarget


//组是否交火过
(group cursorTarget)getVariable ['as_group_fire', false]


//
[getPos player]spawn fn_createS2;

//
player setCaptive true;
player allowDamage false;
player addItem "ItemMap";
as_map_viewed = true;

//
player setVariable ["as_money", 1000];

//添加当前武器弹药
player addItem selectRandom getArray(configfile >> "CfgWeapons" >> (currentWeapon player) >> "magazines");

//
player setCaptive false;
player allowDamage true;
player call FAR_var_init;

player addItem "Chemlight_red";


player addItem "FirstAidKit";//急救箱

itemCargo cursorTarget

player spawn fn_camToUnit;

as_map_viewed = true;
as_end_pos


player addHeadgear "H_HelmetO_ViperSP_hex_F";

//
(findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw", {
	(_this select 0) drawRectangle [
	getPos player,
	800,
	800,
	0,
	[1,1,1,1],
	"#(rgb,8,8,3)color(1,0,0,1)"];
}];


as_map_viewed = true;
player allowDamage false;
player setCaptive true;
player setPos (as_end_pos getPos [10, 0]);
as_end_pos



//
 { deleteVehicle _x} forEach (allMissionObjects "#particlesource");

private _particle = "#particlesource" createVehicleLocal (player getPos [2, 0]); 
 _particle setParticleParams [ 
 ["\a3\Data_f\ParticleEffects\Universal\Universal", 16, 14, 0, 0],  
 "", 
 "Billboard", 
 0,                  
 0.5,                  
 [0,0,0],                
 [(0.2 - (random 0.4)),(0.2 - (random 0.4)),(1.0 + (random 1.0))],  
 0,//旋转速度 
 0.5,//一滴水0.05g  
 0.1,//0.05毫升 
 0.001,  //空气摩擦系数         
 [0.05,0.4], //大小变化              
 [[0.3,0.01,0.01,1],[0.2,0.01,0.01,0]],         
 [0],                 
 0,                  
 0,                
 "",                  
 "",                  
 _particle                
 ];

_particle setParticleRandom [ 
 1,      
 [0, 0, 0],    
 [0.1, 0.1, 1.0],  
 0,      
0,      
 [0, 0, 0, 1],   
 0,      
 0,      
 0     
 ];

_particle setDropInterval 0.005;  


[player, "SupportD21"] call BIS_fnc_addCommMenuItem;